Manual filter to DXL filter

Hello,

I would like to create a filter in dxl similar to a manual filter.

For the manual filter I enter the following:

Filter #1
Link tab
Include objects that:
have
in-links or out-links
*going through any link module
Filter #1 = Has in or out links through *

Filter #2
Attribute: Verification Status
Condition: is empty
Filter #2 = Verification Status is empty

and then I AND the two filters to get,
(Verification Status is empty) AND (Has in or out links through *)
and run this filter to see the statistics that I want for my metrics
Now to avoid running this filter over again I want to code it, so I wrote the following ...
 

int NumBlank, xBlank
int NumLinked, xLink
 
// Number of linked requirements
Filter fLinks = hasLinks(linkFilterBoth, "*")
set (mod, fLinks, NumLinked, xLink)
print "Total No. of linked requirements: ", NumLinked "\n"
 
// Number of Blank requirements that are linked
Filter fEmpty = isEmpty(attribute NameAttr)
Filter fBlank = fEmpty && fLinks
set (mod, fBlank, NumBlank, xBlank)
print "No. of Blank requirements: " NumBlank "\n"

 


I know the isEmpty is completely wrong 'cause it was a wild guess, since I could not find anything regarding returning empty filter values in the dxl manual.

I want to return the same statistic values that I would recieve when running the manual filter, but am lost as to how.

Also, is there a way an output txt file could be created to show the results instead of only viewing through the DXL Interaction GUI?

Thanks in advance

 


SystemAdmin - Tue Jun 05 18:41:09 EDT 2012

Re: Manual filter to DXL filter
SystemAdmin - Wed Jun 06 13:19:20 EDT 2012

  • Uppdate to my previous question **


I've decided to filter for "shall" and "should" statements instead to count the my total # of requirements, since they all are not yet linked, so my code has changed a bit,

 

 

// Count "shall" requirements
Filter fShall = contains(attribute "Object Text", "shall")
set (mod, fShall, NumShall, xShall)
print "No. of 'shall' Requirements: " NumShall "\n"
 
// Count "should" requirements
Filter fShould = contains(attribute "Object Text", "should")
set (mod, fShould, NumShould, xShould)
print "No. of 'should' Requirements: " NumShould "\n"
 
NumReqs = NumShall + NumShould
print "Total No. of Requirements: " NumReqs "\n"
 
// Number of Blank requirements 
Filter fEmpty = isEmpty(attribute "Verification Status") // wild guess that doesn't work
Filter fBlank = fEmpty && (fShall || fShould)
set (mod, fBlank, NumBlank, xBlank)
print "No. of Blank requirements: " NumBlank "\n"



but I still need help with counting the Blank reqs. I want to create the same Filter #2 as states previously and AND it with the shall and should filters OR'd

Any suggestions?



 

 

Re: Manual filter to DXL filter
SystemAdmin - Wed Jun 06 13:53:48 EDT 2012

SystemAdmin - Wed Jun 06 13:19:20 EDT 2012

  • Uppdate to my previous question **


I've decided to filter for "shall" and "should" statements instead to count the my total # of requirements, since they all are not yet linked, so my code has changed a bit,

 

 

// Count "shall" requirements
Filter fShall = contains(attribute "Object Text", "shall")
set (mod, fShall, NumShall, xShall)
print "No. of 'shall' Requirements: " NumShall "\n"
 
// Count "should" requirements
Filter fShould = contains(attribute "Object Text", "should")
set (mod, fShould, NumShould, xShould)
print "No. of 'should' Requirements: " NumShould "\n"
 
NumReqs = NumShall + NumShould
print "Total No. of Requirements: " NumReqs "\n"
 
// Number of Blank requirements 
Filter fEmpty = isEmpty(attribute "Verification Status") // wild guess that doesn't work
Filter fBlank = fEmpty && (fShall || fShould)
set (mod, fBlank, NumBlank, xBlank)
print "No. of Blank requirements: " NumBlank "\n"



but I still need help with counting the Blank reqs. I want to create the same Filter #2 as states previously and AND it with the shall and should filters OR'd

Any suggestions?



 

 

Figured out the Blank filter ... used isNull()

So I guess my only remaining question is, if it is possible to have the results spit out a text file instead of only displaying in the DXL Interaction GUI

Re: Manual filter to DXL filter
SystemAdmin - Thu Jun 28 07:21:33 EDT 2012

SystemAdmin - Wed Jun 06 13:53:48 EDT 2012
Figured out the Blank filter ... used isNull()

So I guess my only remaining question is, if it is possible to have the results spit out a text file instead of only displaying in the DXL Interaction GUI

Use a stream and write...
 

Stream out = write tempFileName 
out << output [string|char|Buffer]